package com.cjc.sport.entity;

import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import java.util.Date;
import java.util.Objects;

/**
 * 课程对象
 */
public class Course {
    /**
     * 课程id
     */
    private String courseId;
    /**
     * 课程分类id
     */
    private String categoryId;
    /**
     * 课程分类名称
     */
    @NotBlank
    @Length(min = 1, max = 10)
    private String categoryName;
    /**
     * 课程序号
     */
    private Integer courseNum;
    /**
     * 课程名称
     */
    @NotBlank
    @Length(min = 1, max = 100)
    private String courseName;
    /**
     * 图片地址
     */
    @NotBlank
    @Length(min = 1, max = 200)
    private String picUrl;
    /**
     * 课程时间
     */
    @NotBlank
    @Length(min = 1, max = 20)
    private String courseTime;
    /**
     * 课程价格
     */
    @NotBlank
    @Length(min = 1, max = 20)
    private String coursePrice;
    /**
     * 课程标签
     */
    @NotBlank
    @Length(min = 1, max = 10)
    private String courseTag;
    /**
     * 详情连接
     */
    @NotBlank
    @Length(min = 1, max = 200)
    private String detailUrl;

    /**
     * 创建时间
     */
    private Date createDate;
    /**
     * 修改时间
     */
    private Date updateDate;

    /**
     * 课程简介
     */
    @NotBlank
    @Length(min = 1, max = 10000)
    private String courseDesc;

    /**
     * set
     *
     * @param categoryId set
     * @return set
     */
    public Course addCategoryId(String categoryId) {
        this.categoryId = categoryId;
        return this;
    }

    /**
     * set
     *
     * @param categoryName set
     * @return set
     */
    public Course addCategoryName(String categoryName) {
        this.categoryName = categoryName;
        return this;
    }

    /**
     * get
     *
     * @return get
     */
    public String getCourseId() {
        return courseId;
    }

//    public void setCourseId(String courseId) {
//        this.courseId = courseId;
//    }

    /**
     * set
     *
     * @param courseId set
     * @return set
     */
    public Course setCourseId(String courseId) {
        this.courseId = courseId;
        return this;
    }

    /**
     * get
     *
     * @return get
     */
    public String getCategoryId() {
        return categoryId;
    }

//    public void setCategoryId(String categoryId) {
//        this.categoryId = categoryId;
//    }

    /**
     * set
     *
     * @param categoryId set
     * @return set
     */
    public Course setCategoryId(String categoryId) {
        this.categoryId = categoryId;
        return this;
    }

    /**
     * get
     *
     * @return get
     */
    public String getCategoryName() {
        return categoryName;
    }

//    public void setCategoryName(String categoryName) {
//        this.categoryName = categoryName;
//    }

    /**
     * set
     *
     * @param categoryName set
     * @return set
     */
    public Course setCategoryName(String categoryName) {
        this.categoryName = categoryName;
        return this;
    }

    /**
     * get
     *
     * @return get
     */
    public Integer getCourseNum() {
        return courseNum;
    }

//    public void setCourseNum(Integer courseNum) {
//        this.courseNum = courseNum;
//    }

    /**
     * set
     *
     * @param courseNum set
     * @return set
     */
    public Course setCourseNum(Integer courseNum) {
        this.courseNum = courseNum;
        return this;
    }

    /**
     * get
     *
     * @return get
     */
    public String getCourseName() {
        return courseName;
    }

//    public void setCourseName(String courseName) {
//        this.courseName = courseName;
//    }

    /**
     * set
     *
     * @param courseName set
     * @return set
     */
    public Course setCourseName(String courseName) {
        this.courseName = courseName;
        return this;
    }

    /**
     * get
     *
     * @return get
     */
    public String getPicUrl() {
        return picUrl;
    }

//    public void setPicUrl(String picUrl) {
//        this.picUrl = picUrl;
//    }

    /**
     * set
     *
     * @param picUrl set
     * @return set
     */
    public Course setPicUrl(String picUrl) {
        this.picUrl = picUrl;
        return this;
    }

    /**
     * get
     *
     * @return get
     */
    public String getCourseTime() {
        return courseTime;
    }

//    public void setCourseTime(String courseTime) {
//        this.courseTime = courseTime;
//    }

    /**
     * set
     *
     * @param courseTime set
     * @return set
     */
    public Course setCourseTime(String courseTime) {
        this.courseTime = courseTime;
        return this;
    }

    /**
     * get
     *
     * @return get
     */
    public String getCoursePrice() {
        return coursePrice;
    }

//    public void setCoursePrice(String coursePrice) {
//        this.coursePrice = coursePrice;
//    }

    /**
     * set
     *
     * @param coursePrice set
     * @return set
     */
    public Course setCoursePrice(String coursePrice) {
        this.coursePrice = coursePrice;
        return this;
    }

    /**
     * get
     *
     * @return get
     */
    public String getCourseTag() {
        return courseTag;
    }

//    public void setCourseTag(String courseTag) {
//        this.courseTag = courseTag;
//    }

    /**
     * set
     *
     * @param courseTag set
     * @return set
     */
    public Course setCourseTag(String courseTag) {
        this.courseTag = courseTag;
        return this;
    }

    /**
     * get
     *
     * @return get
     */
    public String getDetailUrl() {
        return detailUrl;
    }

//    public void setDetailUrl(String detailUrl) {
//        this.detailUrl = detailUrl;
//    }

    /**
     * set
     *
     * @param detailUrl set
     * @return set
     */
    public Course setDetailUrl(String detailUrl) {
        this.detailUrl = detailUrl;
        return this;
    }

    /**
     * get
     *
     * @return get
     */
    public Date getCreateDate() {
        return createDate;
    }

    /**
     * set
     *
     * @param createDate set
     */
    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    /**
     * get
     *
     * @return get
     */
    public Date getUpdateDate() {
        return updateDate;
    }

    /**
     * set
     *
     * @param updateDate set
     */
    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }

    /**
     * get
     *
     * @return get
     */
    public String getCourseDesc() {
        return courseDesc;
    }

    //    public void setCourseDesc(String courseDesc) {
//        this.courseDesc = courseDesc;
//    }

    /**
     * set
     *
     * @param courseDesc set
     * @return set
     */
    public Course setCourseDesc(String courseDesc) {
        this.courseDesc = courseDesc;
        return this;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        Course course = (Course) o;
        return Objects.equals(courseId, course.courseId)
                && Objects.equals(categoryId, course.categoryId)
                && Objects.equals(categoryName, course.categoryName)
                && Objects.equals(courseNum, course.courseNum)
                && Objects.equals(courseName, course.courseName)
                && Objects.equals(picUrl, course.picUrl)
                && Objects.equals(courseTime, course.courseTime)
                && Objects.equals(coursePrice, course.coursePrice)
                && Objects.equals(courseTag, course.courseTag)
                && Objects.equals(detailUrl, course.detailUrl)
                && Objects.equals(courseDesc, course.courseDesc);
    }

    @Override
    public int hashCode() {

        return Objects.hash(courseId, categoryId, categoryName, courseNum,
                courseName, picUrl, courseTime, coursePrice, courseTag, detailUrl, courseDesc);
    }
}